package com.cci.kangdao.wechatOrder.enums.wx;

/**
 * @description: sns地址
 * @author: zyf
 * @create: 2021-03-18
 */
public enum  WxSns {

    OAUTH2_ACCESS_TOKEN("https://api.weixin.qq.com/sns/oauth2/access_token?appid=%s&secret=%s&code=%s&grant_type=authorization_code","获取用户信息"),
    OAUTH2_REFRESH_TOKEN(" https://api.weixin.qq.com/sns/oauth2/refresh_token?appid=%s&grant_type=refresh_token&refresh_token=%s","刷新access_token");



    private String url;
    private String name;

    WxSns(String url, String name) {
        this.url = url;
        this.name = name;
    }

    /**
     * 对请示地址进行参数转换
     *
     * @param body
     * @return
     */
    public String convert(String... body) {
        return String.format(this.getUrl(), body);
    }

    public String getUrl() {
        return this.url;
    }

}
